[Unit]
Description=zookeeper

[Service]
User={{ middleware_user }}
Group={{ middleware_user }}
Environment=PATH=/opt/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
Type=simple
WorkingDirectory={{ middleware_path }}/zookeeper-{{ zk_version }}
PIDFile={{ middleware_path }}/zookeeper-{{ zk_version }}/data/zookeeper_server.pid
ExecStart={{ middleware_path }}/zookeeper-{{ zk_version }}/bin/zkServer.sh start
ExecStop={{ middleware_path }}/zookeeper-{{ zk_version }}/bin/zkServer.sh stop
Restart=always
RestartSec=10
LimitNOFILE=10240

[Install]
WantedBy=multi-user.target